<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>注册</title>
<meta name="keywords" content="">
<meta name="description" content="">
<meta name="viewport" content="width=device-width,minimum-scale=0.5,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
<link rel="stylesheet" href="swiper/reset.css">
<style>
	body{background: #f3eff0;font-family: "微软雅黑";}
	b{font-weight: normal;}
	.outer{width:640px;margin: 0 auto;}
	header{width:640px;height:90px;text-align: center;line-height:90px;font-size:35px;background: #a90506 url(img/zhuce_top.png) no-repeat 26px center;color:#f3eff0;position: relative;}
	.fanhui{width: 42px;height:40px;position: absolute;left:25px;top:25px;}
	section{width: 640px;}
	.mess{width:580px;margin:0 auto;}
	.mess li{margin-top: 30px;line-height: 86px;background: #fff;overflow: hidden;}
	.mess li label{width:130px;height:86px;padding-left:20px;color:#505050;font-size: 25px;background: #fff;float: left;}
	.username,.pass{width:430px;height:86px;border:0;font-size: 25px;float: left;}
	
	
	.btn{width:580px;height:200px;margin:175px auto 0;}
	.zhuce{border: 0;width:580px;height:90px;margin-bottom:10px;border-radius: 7px;font-size: 33px;color:#fff;}
	.zhuce{background: url(img/dengbg.jpg) repeat-x;}
</style>

</head>
<body>
<div class="outer">
	<header>
		<div class="fanhui"></div>
		开心摇摇用户登录
	</header>
	<section>
		<div class="mess">
			<ul>
				<li><label for="zhanghu">账户名称 :</label><input type="text" id="zhanghu" placeholder="请输入账户" class="username"/></li>
				<li><label for="mima">登录密码 :</label><input type="password" id="mima" placeholder="请输入密码" class="pass"/></li>
				<li><label for="qmima">确认密码 :</label><input type="password" id="qmima" placeholder="请输入密码" class="pass"/></li>
			</ul>	
		</div>
		
		<div class="btn">
			<input type="button"  value="确定注册" class="zhuce"/>
		</div>
	</section>
</div>
</body>
<script src="js/jquery.js"></script>
<script src="swiper/zepto.js"></script>
<script src="swiper/touch.js"></script>
<script> 
	function bodyScale(){
		var devicewidth=document.documentElement.clientWidth;
		var scale=devicewidth/640;
		document.body.style.zoom=scale;
	}
	window.onload=window.onresize=function(){
		bodyScale();
	}
	
</script>
<script>
	$(".zhuce").click(function(){
		var zh = $("#zhanghu").val();
		var mm = $("#mima").val();
		var qmm = $("#qmima").val();
		if(zh!="" && mm!="" && qmm!=""){
			if(mm==qmm){
				$.ajax({
					type:"get",
					url:"http://datainfo.duapp.com/shopdata/userinfo.php",
					data:{status:"register",userID:zh,password:mm},
					dataType:"json",
					success:function(data){
						if(data==0){
							alert("用户名重名");
						}
						if(data==1){
							alert("注册成功");
							localStorage.setItem("name",zh);
							window.open("denglu.html","_self");
						}
						if(data==2){
							alert("数据库报错");
						}
						
					}
					
				});
			}else{
				alert("两次密码不一致")
			}
			
		}else{
			alert("账户和密码都不能为空！");
		}
	})
	$(".fanhui").on("touchend",function(){
		window.open("denglu.html","_self")
	})
</script>
</html>